package systemModel

import (
	"CommonsProject/models/commonsModel"
)

// SysRole 系统角色
type SysRole struct {
	commonsModel.Model
	Name   string `form:"name" json:"name" gorm:"column:name;unique;size:30;comment:角色名称"`
	Remark string `from:"remark" json:"remark" gorm:"column:name;unique;size:30;comment:备注"`

	//多对多关系
	SysUsers      []*SysUser      `json:"sysUsers" gorm:"many2many:sys_user_role"`
	SysAuthoritys []*SysAuthority `json:"sysAuthoritys" gorm:"many2many:sys_role_authority"`
}

func (sysRole SysRole) TableName() string {
	return "sys_role"
}
